package com.mproject.connection;

import java.sql.Connection;
import java.sql.DriverManager;

public class DatabaseConnection{
	
	 static String url = "jdbc:mysql://tbthanh-z.comp.nus.edu.sg:3306/";
     static String db = "mproject";
     static String driver = "com.mysql.jdbc.Driver";
     static String user = "root";
     static String pass = "thanh123";
     static Connection con = null;

     public static Connection getConnection() 
       {
	    	//System.out.println("started");
    	 	try
    	 	{
    	 		Class.forName(driver);
                con = DriverManager.getConnection(url + db, user, pass);
         
			return con;
    	 	}
    	 	catch(Exception e)
    	 	{
    	 		e.printStackTrace();
    	 	}
    	 	return null;
       }
}

			